# Maintainer: Caleb Maclennan <caleb@alerque.com>

_project=lua-TestMore
pkgbase=${_project,,}
_rockname=${pkgbase#lua-}
pkgname=("$pkgbase" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
pkgver=0.3.6
_rockrel=1
pkgrel=1
pkgdesc='A Lua port of the Perl Test::More unit testing framework'
arch=(any)
url="https://framagit.org/fperrad/$_project"
license=(MIT)
checkdepends=(lua)
_archive="$_project-$pkgver"
source=("$url/-/archive/$pkgver/$_archive.tar.bz2")
sha256sums=('7724391ad50a32ab55d32171d0901a68a136a404b9f0cd84aa59bf496b6a53b0')

check() {
	cd "$_archive"
	make check
}

_package() {
	cd "$_archive"
	depends=("${pkgname%-*}")
	make LUAVER="$1" PREFIX=/usr DESTDIR="$pkgdir" install
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" COPYRIGHT
}

package_lua-testmore() {
	_package 5.4
}

package_lua53-testmore() {
	_package 5.3
}

package_lua52-testmore() {
	_package 5.2
}

package_lua51-testmore() {
	_package 5.1
}
